<%--
  Created by IntelliJ IDEA.
  User: 24506
  Date: 2019/9/8
  Time: 10:07
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>登入 </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/login.css" media="all">
</head>
<body>
<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>找回密码</h2>
            <p></p>
        </div>
        <div id="sure">
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                <input type="text" name="id" id="LAY-user-login-username" lay-verify="required" placeholder="账号" class="layui-input">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                <input type="text" name="email" id="LAY-user-login-password" lay-verify="required" placeholder="邮箱" class="layui-input">
            </div>
            <div class="layui-form-item" id="zhmM">
                <button type="button" class="layui-btn layui-btn-fluid" >找回密码</button>
            </div>
        </div>
        </div>

        <div id="mreSet">

        </div>




    </div>
</div>
</body>
<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index', function(){
        var $ = layui.jquery
        var sure = $("#sure")
        var mreSet = $("#mreSet")
        mreSet.css("display","none")
        $("#zhmM").on('click',function () {
            var id = $("#LAY-user-login-username").val()
            var email = $("#LAY-user-login-password").val()
            if (id==="" || email===""){
                layer.msg(
                    "用户名/邮箱不能为空", {
                        icon: 2,
                        time: 2000
                    }
                )
                return;
            }
            $.ajax({
                type:'GET',
                url:'/forget/'+id+'/'+email,
                success:function (msg) {
                    layer.msg(msg)
                    if (msg==="true") {
                        layer.msg("信息验证正确",{
                            icon: 1,
                            time:2000
                        })
                        mreSet.css('display','block')
                        sure.css('display','none')
                    }else {
                        layer.msg("账号邮箱不匹配",{
                            icon: 2,
                            time:2000
                        })
                    }
                }
             })
        })
        return;
    })
</script>
</html>
